Don't disable AI prompt Save button when offline#92102
Conversation
Co-authored-by: Nicolás Bonet <NicolasBonet@users.noreply.github.com>
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
|
@Krishna2323 Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
|
@Ollyws @NicolasBonet One of you needs to copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
|
@Ollyws I am the author, so will leave this one for you |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ee8a77d1ec
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
I will review this as it is part of the original issue. |
|
@Expensify/design guys could you confirm this is the intended behavior when we are offline? I added a video in the first post |
|
I think what you're showing in the video makes sense to me, but I would love a gut check from the rest of @Expensify/design. |
|
@MelvinBot could you implement: #92102 (comment) |
Wrap only the prompt text field in OfflineWithFeedback so the queued/faded styling applies to the textarea but not the Save button. Render the error row via a standalone ErrorMessageRow below the button with a 12px top margin, and give the button a 12px gap above it. Co-authored-by: Nicolás Bonet <NicolasBonet@users.noreply.github.com>
|
@bernhardoj Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
|
Done in
See Verified in the browser: offline, the text field fades to ~0.5 opacity while the Save button stays at full opacity (not disabled), and the gaps measure ~12px above both the button and the error row. |
|
|
|
🚧 @NicolasBonet has triggered a test Expensify/App build. You can view the workflow run here. |
This comment has been minimized.
This comment has been minimized.
|
🚧 @NicolasBonet has triggered a test Expensify/App build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
@MelvinBot there is an issue, when offline I still can modify the input and click save again, but if I do there is no feedback and when connection is back we see only the first edit going though. |
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Covers the case where a queued offline save keeps pendingAction=update (isSaving true) and a second offline edit must still call updateAgentPrompt rather than being silently dropped. Co-authored-by: Nicolás Bonet <NicolasBonet@users.noreply.github.com>
|
Good catch Root cause: Fix (already on the branch): the guard now skips while offline — I also added a regression test for exactly this scenario (queued save still pending → second offline edit must still call |
|
The failing check is unrelated to this PR — it's a known flaky test, so I'm not pushing a code fix. The only failing check is This PR only changes the AI prompt profile UI ( Recommended action: re-run the failed Evidence
|
|
Nice, thanks! |
|
@parasharrajat please review |


Explanation of Change
When the agent's AI prompt Save button was tapped while offline,
updateAgentPrompt's optimistic data setpendingAction = UPDATE, which madeisSavingpermanentlytrue(the API call could not resolve while offline) — leaving the button stuck in its loading/disabled state until reconnect.This PR adopts the optimistic, "assume it's done" UX requested by
NicolasBonet:isOfflineviauseNetwork().isSavingwhile offline:isLoading={isSaving && !isOffline}andisDisabled={hasHtmlTag || (isSaving && !isOffline)}. The online flow is unchanged.Buttoninside the existingOfflineWithFeedbackwrapper so the queued-state styling and theonCloseerror dismiss apply to the whole interaction (no duplicate error row).handleSaveruns while offline, immediately fires the existing "Saved" confirmation. The shared logic was extracted into a smalltriggerSavedConfirmationcallback used by both the offline path and the existing online effect.Fixed Issues
$ #92032
PROPOSAL: #92032 (comment)
Tests
Offline tests
OfflineWithFeedback) is shown around the prompt area while the action is pending.QA Steps
Same as tests
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
MacOS: Chrome / Safari
Screen.Recording.2026-05-29.at.12.23.42.PM.mov
iOS Native
Screen.Recording.2026-05-29.at.12.32.59.PM.mov
Offline:
Screen.Recording.2026-06-01.at.2.19.10.PM.mov